% set cnn = AbrirConexionMDB() ZerEgin = Request("ZerEgin") Mail = Request("Mail") if Mail <> "" then session("Mail") = Mail Nombre = Request("Nombre") if Nombre <> "" then session("Nombre") = Nombre Apellidos = Request("Apellidos") if Apellidos <> "" then session("Apellidos") = Apellidos Telefono = Request("Telefono") if Telefono <> "" then session("Telefono") = Telefono Observaciones = Request("Observaciones") if Observaciones <> "" then session("Observaciones") = Observaciones Recogida = Request("Recogida") if Recogida <> "" then session("Recogida") = Recogida Eguna = Request("Eguna") Hilabetea = Request("Hilabetea") Urtea = Request("Urtea") if Eguna <> "" then session("Eguna") = ZeroakJarri(Eguna) if Hilabetea <> "" then session("Hilabetea") = ZeroakJarri(Hilabetea) if Urtea <> "" then session("Urtea") = ZeroakJarri(Urtea) DiaCambioPrecio = DameLunesCercano("castellano") 'seguir comprando if ZerEgin = "seguir" then For i=1 to Session("CantidadProductos") if (Request("Cantidad" & i) = "") OR (Request("Cantidad" & i) = "0") OR (not isnumeric(Request("Cantidad" & i))) then CantidadAct = 1 else CantidadAct = FormatNumber(replace(Request("Cantidad" & i),".",","),2) end if Session("IdCantidad" & i) = CantidadAct Next%> <%response.end end if 'Actualizar Productos if ZerEgin = "actualizar" then For i=1 to Session("CantidadProductos") if (Request("Cantidad" & i) = "") OR (Request("Cantidad" & i) = "0") OR (not isnumeric(Request("Cantidad" & i))) then CantidadAct = 1 else CantidadAct = FormatNumber(replace(Request("Cantidad" & i),".",","),2) end if Session("IdCantidad" & i) = CantidadAct Next end if IdProducto = Request("IdProducto") if not isnumeric(IdProducto) then IdProducto="" end if Unidades = Request("Cantidad") if Unidades = "" then Unidades = 1 'Eliminar Producto if ZerEgin = "Ezabatu" then IdProduktuaEzabatu=Request("IdProduktuaEzabatu") Session("IdProducto" & IdProduktuaEzabatu)=0 Session("IdCantidad" & IdProduktuaEzabatu)=0 end if If IdProducto <> "" then referencia = -1 if Session("CantidadProductos") = "" Then Session("CantidadProductos")=1 else For i=1 to Session("CantidadProductos") if session("IdProducto" & i) = IdProducto then referencia = i next if referencia = -1 then Session("CantidadProductos") = Session("CantidadProductos") + 1 end if end if if referencia = -1 then Session("IdProducto" & Session("CantidadProductos")) = IdProducto Session("IdCantidad" & Session("CantidadProductos")) = Unidades else Session("IdCantidad" & referencia) = cint(Session("IdCantidad" & referencia)) + cint(Unidades) end if end if 'FINALIZAR PEDIDO if ZerEgin = "Caja" then For i=1 to Session("CantidadProductos") if (Request("Cantidad" & i) = "") OR (Request("Cantidad" & i) = "0") OR (not isnumeric(Request("Cantidad" & i))) then CantidadAct = 1 else CantidadAct = FormatNumber(replace(Request("Cantidad" & i),".",","),2) end if Session("IdCantidad" & i) = CantidadAct Next 'MIRAR SI LA FECHA ES CORRECTA PARA LOS PRECIOS Fecha = ZeroakJarri(Request("Eguna")) & "/" & ZeroakJarri(Request("Hilabetea")) & "/" & Request("Urtea") 'MIRAR SI LA FECHA ES PARA HOY 'Quiere hacer un pequeño retoque al formulario de pedido. Si un cliente intentan meter un pedido para el mismo día o para el día siguiente después de las 14 horas, tiene que salir un mensaje de error y que no deje finalizar el pedido. Así se evitan problemas. 'Miramos si el pedido es para el mismo día o el día siguiente: if datediff("d",now(),Fecha)<2 then 'Miramos la hora actual si son más de las 14:00 if hour(now()) >=14 then response.write "
PRODUCTO | " if cint(DameCampo("UdKg","Productos","IdProducto",session("IdProducto" & i)))=0 then Pedido = Pedido & "PRECIO UNITARIO | UNIDADES | " else Pedido = Pedido & "PRECIO / KG. | KILOS | " end if Pedido = Pedido & "SUBTOTAL |
---|---|---|---|---|---|
" & rs("TituloES") & " | " & PonerMoneda(rs("Precio")," €",2) & " /" if rs("UdKg")=0 then Pedido = Pedido & "ud." else Pedido = Pedido & "kg." end if Pedido = Pedido & " | " & Session("IdCantidad" & i) & " | " & PonerMoneda(totalTT," €",2) & " | ||
TOTAL: | " & PonerMoneda(Subtotala," €",2) & " |
Su pedido ha sido realizado correctamente.<%=TemaFecha%>
En breve nos pondremos en contacto con usted.